using Andromeda.Global.Business.DataObject;
using ForgeIt.Dal.dbo;
using System;

using System.Collections.Generic;
using System.Linq;
using Andromeda.Global.Data;

namespace ForgeIt.Business.Stub
{
	public abstract class LicenseInformationStub : DataObjectModelBase
	{
		#region private fields


		private DBLicenseInformation foDBLicenseInformation;

        private License localIdLicense;


		#endregion private fields
    
		#region public constructors

		protected LicenseInformationStub()
			: this(new DBLicenseInformation())
		{
		}

        protected LicenseInformationStub(License foIdLicense)
          :this()
        {
            SetIdLicense(foIdLicense);
        }

		#endregion public constructors
    

		#region internal constructors

		internal LicenseInformationStub(DBLicenseInformation foDBLicenseInformation)
		{

			this.foDBLicenseInformation = foDBLicenseInformation;

		}

		#endregion internal constructors
  

		#region protected datasource properties
		

		internal DBLicenseInformation DB_DBLicenseInformation
		{
			get { return foDBLicenseInformation ?? (foDBLicenseInformation = new DBLicenseInformation()); }
		}

		
		public override DataConnectorCollection DataObjects
		{
			get
			{
				return new DataConnectorCollection { foDBLicenseInformation } ;
			}
		}

		

		/// 
		///
		/// 
		public int IdLicenseInformation
		{
			get { return DB_DBLicenseInformation.IdLicenseInformation; }

		}

		/// 
		///
		/// 
		public int IdLicense
		{
			get { return DB_DBLicenseInformation.IdLicense; }

			set { DB_DBLicenseInformation.IdLicense = value; }

		}

		/// 
		///
		/// 
		public string Name
		{
			get { return DB_DBLicenseInformation.Name; }

			set { DB_DBLicenseInformation.Name = value; }

		}

		/// 
		///
		/// 
		public string Value
		{
			get { return DB_DBLicenseInformation.Value; }

			set { DB_DBLicenseInformation.Value = value; }

		}

		/// 
		///
		/// 
		public byte[] ImageValue
		{
			get { return DB_DBLicenseInformation.ImageValue; }

			set { DB_DBLicenseInformation.ImageValue = value; }

		}

		#endregion protected datasource properties
    
		#region protected datasource foreign key properties
    

		///<summary>
		/// Getter method for obtainin a foreign key <see cref="License"/> object related to this object
		///</summary>
		public virtual License GetIdLicense()
		{
          return localIdLicense ?? (localIdLicense = new License(foDBLicenseInformation.GetFK_IdLicense()));
		}
    

  		///<summary>
  		/// Setter method for linking this object to a foreign key object
  		///</summary>
  		///<param name="item">The <see cref="License"/> object to which we want to link our IdLicense</param>
  		public virtual void SetIdLicense(License item)
        {
          foDBLicenseInformation.SetFK_IdLicense(item.DB_DBLicense);
          localIdLicense = new License(foDBLicenseInformation.GetFK_IdLicense());
        }

  
		#endregion protected datasource foreign key properties
    
		#region protected datasource external key properties
    

  
		#endregion protected datasource external key properties
    
		#region properties
    

		#endregion properties
    
		#region methods methods

		#endregion methods

        #region Static Factories

        public static LicenseInformation GetLicenseInformation(int foIdLicenseInformation)
        {
          return new LicenseInformation(DBLicenseInformation.GetEntity(foIdLicenseInformation));
        }
  
        public static IEnumerable<LicenseInformation> ListLicenseInformation()
        {
            return (from DBLicenseInformation entity in DBLicenseInformation.ListEntity() select new LicenseInformation(entity));
        }
        
  
        public static IEnumerable<LicenseInformation> ListLicenseInformation(object foIdLicenseInformation, object foIdLicense, object foName, object foValue, object foImageValue)
        {
            return (from DBLicenseInformation entity in DBLicenseInformation.ListEntity(foIdLicenseInformation, foIdLicense, foName, foValue, foImageValue) select new LicenseInformation(entity));
        }
        
        #endregion Static List Methods

	
  }
}